//
//  WYTGreetingVC.m
//  Diary
//
//  Created by lanou3g on 15/10/27.
//  Copyright © 2015年 王艺拓. All rights reserved.
//

#import "WYTGreetingVC.h"
#import "WYTGreetingView.h"
#import "GHAllDiaryVC.h"

@interface WYTGreetingVC ()

@property (nonatomic, strong)WYTGreetingView *rootView;

@end

@implementation WYTGreetingVC

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setUpView];
}

- (void)setUpView{
    self.rootView = [[WYTGreetingView alloc]init];
    self.rootView.frame = [UIScreen mainScreen].bounds;
    self.view = self.rootView;
    
    [self.rootView.toShellButton addTarget:self action:@selector(chickToShellBtn) forControlEvents:1<<6];
    
    // 下拉轻扫手势
    UISwipeGestureRecognizer *swipGesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(chickSwipe:)];
    swipGesture.direction = UISwipeGestureRecognizerDirectionDown;
    [self.view addGestureRecognizer:swipGesture];
}
// 下拉手势方法的实现
- (void)chickSwipe:(UISwipeGestureRecognizer *)swipe
{
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)chickToShellBtn
{
    GHAllDiaryVC *diaryShelfVC = [[GHAllDiaryVC alloc] init];
    [self presentViewController:diaryShelfVC animated:YES completion:nil];
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}



@end
